package day05;

public class Test2 {
    public static void main(String[] args) {
        //新建car对象
        //把对象的内存地址，保存到变量c1
        Car c1 = new Car();
        Car c2 = new Car();
        //为c1对象的三个属性赋值
        c1.brand = "宝马";
        c1.color = "白色";
        c1.speed = 240;
        c2.brand = "奔驰";
        c2.color = "黑色";
        c2.speed = 300;
        //控制c1执行go()方法，或stop方法
        c1.go();
        c1.stop();
        c2.go();
        c2.stop();
    }

}
